package com.edu.service.Impl;

import com.edu.dao.Impl.UserDaoImpl;
import com.edu.dao.UserDao;
import com.edu.entity.Book;
import com.edu.entity.User;
import com.edu.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao userDao=new UserDaoImpl();

    public  List<User> queryUser(String userName,String userPass) {
        List<User> list=userDao.queryUser(userName, userPass);
        if(list.size()==0) {
            System.out.println("没有查询到数据！！！！");
        }
        return list;
    }

    @Override
    public boolean insertUser(User user) {
        int rowNum=userDao.insertUser(user);
        if(rowNum==1) {
            return true;
        }
        return false;
    }

    @Override
    public List<Book> queryBook() {
        List<Book> list=userDao.queryBook();
        return list;
    }
}
